#version 460

layout (location=0) in vec3 VertexPosition;
layout (location=1) in vec3 VertexNormal;
layout (location=0) out vec2 matcapUV;

uniform mat4 MVP;
uniform mat3 NormalMatrix;
void main()
{
    vec3 normalView = normalize(NormalMatrix * VertexNormal);
    matcapUV = normalView.xy*0.5f + 0.5f;
    gl_Position = MVP*vec4(VertexPosition,1.0);
}
